home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / NB.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.3 KB  |  83 lines

  1. /* Numeric gadgets */
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
  8. call RxMUIOpt("DebugMode ShowErr")
  9.  
  10. call createApp
  11. call SetNotifies
  12.  
  13. call set("win","open",1)
  14.  
  15. call handleApp
  16. exit
  17. /***********************************************************************/
  18. handleApp: procedure
  19. ctrl_c=2**12
  20. s=0
  21. do forever
  22.     call handle("APP","H",s)
  23.     do i=0 to h.num-1
  24.         if h.i="QUIT" then exit
  25.         say h.num-1 h.i
  26.     end
  27.     s=Wait(or(h.signals,ctrl_c))
  28.     if and(s,ctrl_c)>0 then exit
  29. end
  30. exit
  31. /***********************************************************************/
  32. err: procedure expose sigl rxmuierror
  33. parse arg res
  34. say sigl "["res"]"
  35.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  36.     exit
  37. /***********************************************************************/
  38. createApp: procedure
  39.     app.Title="NumericButton"
  40.     app.Version="$VER: NumericButton 1.0 (10.12.99)"
  41.     app.Copyright="©1999, alfie"
  42.     app.Author="alfie"
  43.     app.Description="NumericButton example"
  44.     app.Base="RXMUIEXAMPLE"
  45.     app.SubWindow="WIN"
  46.      win.ID="MAIN"
  47.      win.Title="NumericButton Example"
  48.      win.Contents="MGROUP"
  49.       mgroup.0="g"
  50.        g.class="group"
  51.        g.horiz=1
  52.         g.0=hspace()
  53.         g.1="ng"
  54.          ng.class="group"
  55.           ng.0="nb0"
  56.            nb0.class="numericbutton"
  57.            nb0.Format="1B63"x || "Val:%lx"
  58.           ng.1="nb1"
  59.            nb1.class="numericbutton"
  60.            nb1.stringify="parse arg val; if val=0 then return '1B63'x || 'None';else return '1B63'x || 'Value:' val"
  61.         g.2=hspace()
  62.  
  63.     res=NewObj("APPLICATION","APP")
  64.     if res~=0 then call err(res)
  65.  
  66.     return
  67. /***********************************************************************/
  68. setNotifies: procedure
  69.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  70.     if res~=0 then call err(res)
  71.  
  72.     call Notify("nb0","value","everytime","APP","RETURNID")
  73.     call Notify("nb0","value","everytime","nb1","set","value","triggervalue")
  74.     call Notify("nb1","value","everytime","nb0","set","value","triggervalue")
  75.  
  76.     return
  77. /***********************************************************************/
  78. halt:
  79. break_c:
  80.     exit
  81. /**************************************************************************/
  82.  
  83.